package com.woniuxy02;

import java.io.UnsupportedEncodingException;
import java.util.Arrays;
import java.util.Scanner;

/**
 * @author 作者
 * @create 2025-06-04 11:05
 */
public class Test06 {
    public static void main(String[] args) throws UnsupportedEncodingException {
        String str="abcabc";
        System.out.println(str.indexOf(98));
        System.out.println(str.indexOf('b'));
        System.out.println(str.indexOf('b',5));
        System.out.println("abcd".substring(1));
        System.out.println("abcd".substring(1,4));
//        System.out.println("abcd".substring(1,5));
        char[] chars = str.toCharArray();
        System.out.println(Arrays.toString(chars));
        System.out.println(Arrays.toString("abcd".getBytes()));
        System.out.println(Arrays.toString("中文".getBytes()));
        System.out.println(Arrays.toString("中文".getBytes("utf-8")));
        System.out.println(Arrays.toString("中文".getBytes("gbk")));
    }

}
